package com.spzx.user.controller;


import com.spzx.common.core.domain.R;
import com.spzx.common.core.web.controller.BaseController;
import com.spzx.common.security.annotation.InnerAuth;
import com.spzx.user.api.domain.UserBrowseHistory;
import com.spzx.user.service.IUserBrowseHistoryService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户浏览记录表 前端控制器
 * </p>
 *
 * @author atguigu
 * @since 2024-11-18
 */
@RestController
@RequestMapping("/userBrowseHistory")
public class UserBrowseHistoryController extends BaseController {

    @Autowired
    private IUserBrowseHistoryService userBrowseHistoryService;

    /**
     * 远调保存浏览记录接口
     *
     * @param userBrowseHistory
     * @return
     */
    @InnerAuth
    @Operation(summary = "供微服务内部远程调用保存浏览器记录的接口")
    @PostMapping("/saveUserBrowseHistory")
    public R<?> saveUserBrowseHistory(@RequestBody UserBrowseHistory userBrowseHistory) {
        userBrowseHistoryService.saveUserBrowseHistory(userBrowseHistory);
        return R.ok();
    }
}
